import { request, config } from 'utils';

const { api: { jobs } } = config;

export async function createJob (params) {
  return request({
    url: jobs.createJob,
    method: 'post',
    data: params,
  });
}

export async function getUsersWithJob (params) {
  return request({
    url: jobs.getUsersWithJob,
    method: 'get',
    data: params,
  });
}

export async function allCanSelectedUsers (params) {
  return request({
    url: jobs.allCanSelectedUsers,
    method: 'get',
    data: params,
  });
}

export async function addUsersToJob (params) {
  return request({
    url: jobs.addUsersToJob,
    method: 'post',
    data: params,
  });
}

export async function removeUsersFromJob (params) {
  return request({
    url: jobs.removeUsersFromJob,
    method: 'post',
    data: params,
  });
}

export async function getAllJobs () {
  // console.log('开始检查职位接口', jobs.getAllJobs);
  return request({
    url: jobs.getAllJobs,
    method: 'get',
    data: {},
  });
}
